Retrieving public data for blockchain networks using trusted execution environments

ABSTRACT

Disclosed herein are methods, systems, and apparatus, including computer programs encoded on computer storage media, for performing an attestation verification. One of the methods includes sending an attestation request to a relay system node by a relay system controller. The relay system controller receives an attestation evidence of the relay system node from the relay system node. The relay system controller sends the attestation evidence of the relay system node to an attestation verification server. The relay system controller receives an attestation verification report from the attestation verification server. The relay system controller sends the attestation verification report to a relay system smart contract.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of PCT Application No.PCT/CN2019/096036, filed on Jul. 15, 2019, and a continuation in part of(i) PCT Application No. PCT/CN2019/079800, filed on Mar. 27, 2019 and(ii) PCT Application No. PCT/CN2019/080478, filed on Mar. 29, 2019. Thecontent of each of the foregoing applications is hereby incorporated byreference in its entirety.

TECHNICAL FIELD

This specification relates to providing data to a blockchain networkfrom an external data source.

BACKGROUND

Distributed ledger systems (DLSs), which can also be referred to asconsensus networks, and/or blockchain networks, enable participatingentities to securely, and immutably store data. DLSs are commonlyreferred to as blockchain networks without referencing any particularuse case. An example type of blockchain network can include consortiumblockchain networks provided for a select group of entities, whichcontrol the consensus process, and includes an access control layer.

Smart contracts are programs that execute on blockchains. In someinstances, the smart contract running on the blockchain requires inputfrom outside of the blockchain to evaluate pre-defined rules and performcorresponding actions. However, the smart contract itself cannotdirectly access external data sources. Consequently, a relay agent canbe used to retrieve external data, and submit the data to the blockchainfor processing by the smart contract. This process, however, can resultin security issues, such as potential attack vectors (e.g., distributeddenial-of-service (DDoS) attacks). Further, each client may be requiredto individually authenticate the remote agent, which hindersscalability, and increases resource overhead (e.g., processors, memory,bandwidth).

Although techniques have been proposed for addressing security issuesassociated with data retrieval from external data sources, a moreeffective solution to address the security issues would be advantageous.

SUMMARY

This specification describes technologies for retrieval of data fromexternal data sources for processing within a blockchain network.Embodiments of this specification are directed to a relay system that isused to retrieve publicly available data and/or services from theexternal data source.

In some embodiments, remote attestation is performed for each of aplurality of relay system nodes, the remote attestation resulting in akey pair (public key, private key) for each relay system node. Eachrelay system node operates using a trusted execution environment (TEE).A relay system smart contract is used for remote authentication of therelay system node, which can be audited publicly, eliminating the needfor individual clients to repeat remote authentication. Authenticatedrelay system nodes are registered for use, and a relay system node israndomly selected for querying the external data source. A response thatincludes the result of the query is digitally signed using the privatekey of the relay system node. The response can be verified by the relaysystem smart contract using the public key of the relay system node.

This specification also provides one or more non-transitorycomputer-readable storage media coupled to one or more processors andhaving instructions stored thereon which, when executed by the one ormore processors, cause the one or more processors to perform operationsin accordance with embodiments of the methods provided herein.

This specification further provides a system for implementing themethods provided herein. The system includes one or more processors, anda computer-readable storage medium coupled to the one or more processorshaving instructions stored thereon which, when executed by the one ormore processors, cause the one or more processors to perform operationsin accordance with embodiments of the methods provided herein.

It is appreciated that methods in accordance with this specification mayinclude any combination of the aspects and features described herein.That is, methods in accordance with this specification are not limitedto the combinations of aspects and features specifically describedherein, but also include any combination of the aspects and featuresprovided.

The details of one or more embodiments of this specification are setforth in the accompanying drawings and the description below. Otherfeatures and advantages of this specification will be apparent from thedescription and drawings, and from the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating an example of an environment that canbe used to execute embodiments of this specification.

FIG. 2 is a diagram illustrating an example of a conceptual architecturein accordance with embodiments of this specification.

FIG. 3 is a diagram illustrating an example of a system in accordancewith embodiments of this specification.

FIG. 4 is a signal flow illustrating an example of a process that can beexecuted in accordance with embodiments of this specification.

FIG. 5 is a signal flow illustrating an example of a process that can beexecuted in accordance with embodiments of this specification.

FIG. 6 is a flowchart illustrating an example of a process that can beexecuted in accordance with embodiments of this specification.

FIG. 7 is a diagram illustrating an example of modules of an apparatusin accordance with embodiments of this specification.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

This specification describes technologies for providing data to ablockchain network from an external data source. More particularly, andas described in further detail herein, embodiments of this specificationare directed to a relay system that is used to retrieve publiclyavailable data and/or services from the external data source.

In some embodiments, remote attestation is performed for each of aplurality of relay system nodes, the remote attestation resulting in akey pair (public key, private key) for each relay system node. Eachrelay system node operates using a trusted execution environment (TEE).A relay system smart contract is used for remote authentication of therelay system node, which can be audited publicly, eliminating the needfor individual clients to repeat remote authentication. Authenticatedrelay system nodes are registered for use, and a relay system node israndomly selected for querying the external data source. A response thatincludes the result of the query is digitally signed using the privatekey of the relay system node. The response can be verified by the relaysystem smart contract using the public key of the relay system node.

The techniques described in this specification produce several technicaleffects. For example, the specification discloses a relay systemincluding a relay system smart contract, a relay system controller, anda relay system node for facilitating querying internet data source by ablockchain, where the relay system controller is used for relaying dataor requests between a user of the blockchain and the relay system node.As described herein, embodiments of this specification ensure theintegrity of responses provided back to the blockchain network fromexternal data sources. Accordingly, embodiments of this specificationimprove the integrity of communications between a blockchain network,and components of a relay system that is used to retrieve data that isexternal to the blockchain network. In this manner, potential attackchannels for malicious users are mitigated to enhance security. Asanother example, the relay system of this specification facilitatesavoiding a direct contact between the user and the relay system node,thereby avoiding exposing a position or access point of the relay systemnode. As such, the relay system node is less likely to be found andattacked by malicious actors over the network in many forms, such as,for example, DDoS attacks. This improves a security of the relay systemnode, thereby further improving a security of the communication betweenthe blockchain network and the relay system node.

To provide further context for embodiments of this specification, and asintroduced above, distributed ledger systems (DLSs), which can also bereferred to as consensus networks (e.g., made up of peer-to-peer nodes),and blockchain networks, enable participating entities to securely, andimmutably conduct transactions, and store data. Although the termblockchain is generally associated with particular networks, and/or usecases, blockchain is used herein to generally refer to a DLS withoutreference to any particular use case.

A blockchain is a data structure that stores transactions in a way thatthe transactions are immutable. Thus, transactions recorded on ablockchain are reliable and trustworthy. A blockchain includes one ormore blocks. Each block in the chain is linked to a previous blockimmediately before it in the chain by including a cryptographic hash ofthe previous block. Each block also includes a timestamp, its owncryptographic hash, and one or more transactions. The transactions,which have already been verified by the nodes of the blockchain network,are hashed and encoded into a Merkle tree. A Merkle tree is a datastructure in which data at the leaf nodes of the tree is hashed, and allhashes in each branch of the tree are concatenated at the root of thebranch. This process continues up the tree to the root of the entiretree, which stores a hash that is representative of all data in thetree. A hash purporting to be of a transaction stored in the tree can bequickly verified by determining whether it is consistent with thestructure of the tree.

Whereas a blockchain is a decentralized or at least partiallydecentralized data structure for storing transactions, a blockchainnetwork is a network of computing nodes that manage, update, andmaintain one or more blockchains by broadcasting, verifying andvalidating transactions, etc. As introduced above, a blockchain networkcan be provided as a public blockchain network, a private blockchainnetwork, or a consortium blockchain network. Embodiments of thisspecification are described in further detail herein with reference to aconsortium blockchain network. It is contemplated, however, thatembodiments of this specification can be realized in any appropriatetype of blockchain network.

In general, a consortium blockchain network is private among theparticipating entities. In a consortium blockchain network, theconsensus process is controlled by an authorized set of nodes, which canbe referred to as consensus nodes, one or more consensus nodes beingoperated by a respective entity (e.g., a financial institution,insurance company). For example, a consortium of ten (10) entities(e.g., financial institutions, insurance companies) can operate aconsortium blockchain network, each of which operates at least one nodein the consortium blockchain network.

In some examples, within a consortium blockchain network, a globalblockchain is provided as a blockchain that is replicated across allnodes. That is, all consensus nodes are in perfect state consensus withrespect to the global blockchain. To achieve consensus (e.g., agreementto the addition of a block to a blockchain), a consensus protocol isimplemented within the consortium blockchain network. For example, theconsortium blockchain network can implement a practical Byzantine faulttolerance (PBFT) consensus, described in further detail below.

FIG. 1 is a diagram illustrating an example of an environment 100 thatcan be used to execute embodiments of this specification. In someexamples, the environment 100 enables entities to participate in aconsortium blockchain network 102. The environment 100 includescomputing devices 106, 108, and a network 110. In some examples, thenetwork 110 includes a local area network (LAN), wide area network(WAN), the Internet, or a combination thereof, and connects web sites,user devices (e.g., computing devices), and back-end systems. In someexamples, the network 110 can be accessed over a wired and/or a wirelesscommunications link. In some examples, the network 110 enablescommunication with, and within the consortium blockchain network 102. Ingeneral the network 110 represents one or more communication networks.In some cases, the computing devices 106, 108 can be nodes of a cloudcomputing system (not shown), or each computing device 106, 108 can be aseparate cloud computing system including a number of computersinterconnected by a network and functioning as a distributed processingsystem.

In the depicted example, the computing systems 106, 108 can each includeany appropriate computing system that enables participation as a node inthe consortium blockchain network 102. Examples of computing devicesinclude, without limitation, a server, a desktop computer, a laptopcomputer, a tablet computing device, and a smartphone. In some examples,the computing systems 106, 108 host one or more computer-implementedservices for interacting with the consortium blockchain network 102. Forexample, the computing system 106 can host computer-implemented servicesof a first entity (e.g., user A), such as a transaction managementsystem that the first entity uses to manage its transactions with one ormore other entities (e.g., other users). The computing system 108 canhost computer-implemented services of a second entity (e.g., user B),such as a transaction management system that the second entity uses tomanage its transactions with one or more other entities (e.g., otherusers). In the example of FIG. 1, the consortium blockchain network 102is represented as a peer-to-peer network of nodes, and the computingsystems 106, 108 provide nodes of the first entity, and second entityrespectively, which participate in the consortium blockchain network102.

FIG. 2 depicts an example of an architecture 200 in accordance withembodiments of this specification. The example conceptual architecture200 includes participant systems 202, 204, 206 that correspond toParticipant A, Participant B, and Participant C, respectively. Eachparticipant (e.g., user, enterprise) participates in a blockchainnetwork 212 provided as a peer-to-peer network including a plurality ofnodes 214, at least some of which immutably record information in ablockchain 216. Although a single blockchain 216 is schematicallydepicted within the blockchain network 212, multiple copies of theblockchain 216 are provided, and are maintained across the blockchainnetwork 212, as described in further detail herein.

In the depicted example, each participant system 202, 204, 206 isprovided by, or on behalf of Participant A, Participant B, andParticipant C, respectively, and functions as a respective node 214within the blockchain network. As used herein, a node generally refersto an individual system (e.g., computer, server) that is connected tothe blockchain network 212, and enables a respective participant toparticipate in the blockchain network. In the example of FIG. 2, aparticipant corresponds to each node 214. It is contemplated, however,that a participant can operate multiple nodes 214 within the blockchainnetwork 212, and/or multiple participants can share a node 214. In someexamples, the participant systems 202, 204, 206 communicate with, orthrough the blockchain network 212 using a protocol (e.g., hypertexttransfer protocol secure (HTTPS)), and/or using remote procedure calls(RPCs).

Nodes 214 can have varying degrees of participation within theblockchain network 212. For example, some nodes 214 can participate inthe consensus process (e.g., as miner nodes that add blocks to theblockchain 216), while other nodes 214 do not participate in theconsensus process. As another example, some nodes 214 store a completecopy of the blockchain 216, while other nodes 214 only store copies ofportions of the blockchain 216. For example, data access privileges canlimit the blockchain data that a respective participant stores withinits respective system. In the example of FIG. 2, the participant systems202, 204, and 206 store respective, complete copies 216′, 216″, and216′″ of the blockchain 216.

A blockchain (e.g., the blockchain 216 of FIG. 2) is made up of a chainof blocks, each block storing data. Examples of data include transactiondata representative of a transaction between two or more participants.While transactions are used herein by way of non-limiting example, it iscontemplated that any appropriate data can be stored in a blockchain(e.g., documents, images, videos, audio). Examples of a transaction caninclude, without limitation, exchanges of something of value (e.g.,assets, products, services, currency). The transaction data is immutablystored within the blockchain. That is, the transaction data cannot bechanged.

Before storing in a block, the transaction data is hashed. Hashing is aprocess of transforming the transaction data (provided as string data)into a fixed-length hash value (also provided as string data). It is notpossible to un-hash the hash value to obtain the transaction data.Hashing ensures that even a slight change in the transaction dataresults in a completely different hash value. Further, and as notedabove, the hash value is of fixed length. That is, no matter the size ofthe transaction data the length of the hash value is fixed. Hashingincludes processing the transaction data through a hash function togenerate the hash value. An example of a hash function includes, withoutlimitation, the secure hash algorithm (SHA)-256, which outputs 256-bithash values.

Transaction data of multiple transactions are hashed and stored in ablock. For example, hash values of two transactions are provided, andare themselves hashed to provide another hash. This process is repeateduntil, for all transactions to be stored in a block, a single hash valueis provided. This hash value is referred to as a Merkle root hash, andis stored in a header of the block. A change in any of the transactionswill result in change in its hash value, and ultimately, a change in theMerkle root hash.

Blocks are added to the blockchain through a consensus protocol.Multiple nodes within the blockchain network participate in theconsensus protocol, and perform work to have a block added to theblockchain. Such nodes are referred to as consensus nodes. PBFT,introduced above, is used as a non-limiting example of a consensusprotocol. The consensus nodes execute the consensus protocol to addtransactions to the blockchain, and update the overall state of theblockchain network.

In further detail, the consensus node generates a block header, hashesall of the transactions in the block, and combines the hash value inpairs to generate further hash values until a single hash value isprovided for all transactions in the block (the Merkle root hash). Thishash is added to the block header. The consensus node also determinesthe hash value of the most recent block in the blockchain (i.e., thelast block added to the blockchain). The consensus node also adds anonce value, and a timestamp to the block header.

In general, PBFT provides a practical Byzantine state machinereplication that tolerates Byzantine faults (e.g., malfunctioning nodes,malicious nodes). This is achieved in PBFT by assuming that faults willoccur (e.g., assuming the existence of independent node failures, and/ormanipulated messages sent by consensus nodes). In PBFT, the consensusnodes are provided in a sequence that includes a primary consensus node,and backup consensus nodes. The primary consensus node is periodicallychanged. Transactions are added to the blockchain by all consensus nodeswithin the blockchain network reaching an agreement as to the worldstate of the blockchain network. In this process, messages aretransmitted between consensus nodes, and each consensus nodes provesthat a message is received from a specified peer node, and verifies thatthe message was not modified during transmission.

In PBFT, the consensus protocol is provided in multiple phases with allconsensus nodes beginning in the same state. To begin, a client sends arequest to the primary consensus node to invoke a service operation(e.g., execute a transaction within the blockchain network). In responseto receiving the request, the primary consensus node multicasts therequest to the backup consensus nodes. The backup consensus nodesexecute the request, and each sends a reply to the client. The clientwaits until a threshold number of replies are received. In someexamples, the client waits for f+1 replies to be received, where f isthe maximum number of faulty consensus nodes that can be toleratedwithin the blockchain network. The final result is that a sufficientnumber of consensus nodes come to an agreement on the order of therecord that is to be added to the blockchain, and the record is eitheraccepted, or rejected.

In some blockchain networks, cryptography is implemented to maintainprivacy of transactions. For example, if two nodes want to keep atransaction private, such that other nodes in the blockchain networkcannot discern details of the transaction, the nodes can encrypt thetransaction data. An example of cryptography includes, withoutlimitation, symmetric encryption, and asymmetric encryption. Symmetricencryption refers to an encryption process that uses a single key forboth encryption (generating ciphertext from plaintext), and decryption(generating plaintext from ciphertext). In symmetric encryption, thesame key is available to multiple nodes, so each node can en-/de-crypttransaction data.

Asymmetric encryption uses keys pairs that each include a private key,and a public key, the private key being known only to a respective node,and the public key being known to any or all other nodes in theblockchain network. A node can use the public key of another node toencrypt data, and the encrypted data can be decrypted using other node'sprivate key. For example, and referring again to FIG. 2, Participant Acan use Participant B's public key to encrypt data, and send theencrypted data to Participant B. Participant B can use its private keyto decrypt the encrypted data (ciphertext) and extract the original data(plaintext). Messages encrypted with a node's public key can only bedecrypted using the node's private key.

Asymmetric encryption is used to provide digital signatures, whichenables participants in a transaction to confirm other participants inthe transaction, as well as the validity of the transaction. Forexample, a node can digitally sign a message, and another node canconfirm that the message was sent by the node based on the digitalsignature of Participant A. Digital signatures can also be used toensure that messages are not tampered with in transit. For example, andagain referencing FIG. 2, Participant A is to send a message toParticipant B. Participant A generates a hash of the message, and then,using its private key, encrypts the hash to provide a digital signatureas the encrypted hash. Participant A appends the digital signature tothe message, and sends the message with digital signature to ParticipantB. Participant B decrypts the digital signature using the public key ofParticipant A, and extracts the hash. Participant B hashes the messageand compares the hashes. If the hashes are same, Participant B canconfirm that the message was indeed from Participant A, and was nottampered with.

In some instances, a smart contract executing within the blockchainnetwork requires input from outside of the blockchain network toevaluate pre-defined rules and perform corresponding actions. By way ofnon-limiting example, a stock quote might be needed for the smartcontract to base a decision on, the stock quote coming from a datasource external to the blockchain network. As another non-limitingexample, account information for an account that is maintained outsideof the blockchain network might be needed to for the smart contract tobase a decision on. However, the smart contract itself cannot directlyquery external data sources.

Traditional approaches include use of a relay agent to retrieve externaldata, and submit the data to the blockchain for processing by the smartcontract. For example, Internet-connected computer servers can provideopen data services to Internet users generally. In some examples, dataaccess services are provided through protocols such as, hypertexttransfer protocol (HTTP), secure HTTP (HTTPS), and file transferprotocol (FTP). Any computing device connected to the Internet canaccess such services to obtain data (e.g., even without accesscredentials). Because a smart contract executing within a blockchainnetwork cannot itself directly access the Internet-based service, anintermediate agent can be used to submit requests for, and retrievedata, and provide the data to the blockchain network for use by thesmart contract.

An issue with this, however, is how to ensure that the agent accessesthe data in a complete, non-compromised process. This can include, amongother things, ensuring that the agent actually performed the accessbehavior, that the accessed service is a real, expected Internetservice, that the request sent has not been tampered with, and that thereturned data has not been tampered with. Further, it should also beensured that the agent is the intended agent, rather than acounterfeiter.

In one traditional approach that uses SGX, the TA, or portion of the TA,executing in an enclave (enclave program) functions as a relay node(intermediate agent) to access external data sources. For example, theenclave program can send a query request (e.g., HTTPS request) to anInternet-based data source, and can provide the response to the smartcontract that initiated the request. Such a traditional approach,however, has disadvantages. An example disadvantage is that each userneeds to separately access and remotely authenticate the relay node.Because access to the relay node is directly exposed, an attacker (e.g.,malicious user) can perform a distributed denial-of-service (DDoS)attack, or other forms of attach to block users from performingauthentication of the relay node. Further, because the user logic isstrongly coupled with the relay node key (e.g., SGX private key), it isdifficult to implement a cluster of relay nodes to extend serviceavailability, and/or disaster recovery handover from a downed relaynode.

In view of the above context, embodiments of the present specificationare directed to querying external data sources (e.g., Internet-baseddata sources) using a relay system and TEE. More particularly, and asdescribed in further detail herein, embodiments of this specificationprovide for use of a smart contract to perform the TEE remoteverification (remote attestation, described herein), thereby avoidingdirect access by the user, or client to the relay node. In this manner,and among other advantages, the attack surface is reduced, whichinhibits potential attack vectors, and the coupling between the userlogic and the relay system is reduced, which enhances the scalability,and improves the data uplink service capability.

FIG. 3 is a diagram illustrating an example of a system 300 inaccordance with embodiments of this specification. As shown, system 300includes a blockchain 302, a relay system controller 308, a relay systemnode 310, an attestation service 312, and a network 314 (e.g.,Internet). In the depicted example, the blockchain 302 includes a clientsmart contract 304 and a relay system smart contract 306. In someembodiments, the relay system node 310 is implemented using a TEEtechnology (e.g., Intel SGX). In general, the attestation service 312verifies a legitimacy of the relay system node 310 for the client smartcontract 304. An example attestation service includes IAS, describedabove. As described herein, the relay system smart contract 306, therelay system controller 308, and the relay system node 310 operatetogether as a relay system to relay data or requests from the clientsmart contract 304 to the network 314 (e.g., an external data sourcethat is accessible through the network 314), and to relay data orrequest results from the network 314 to the client smart contract 304.

The client smart contract 304 is a smart contract that operates as arequester that requests data or service from the network 314. In someembodiments, an offline owner of the client smart contract 304, forexample, a client or user (not shown), may send a data or request to orgenerate the data or service request at the client smart contract 304.The data or request may be a datagram element. The client smart contract304 is communicatively coupled to the relay system contract 306. Forexample, the client smart contract 304 may send a request to the relaysystem smart contract 306 and receive a request result from the relaysystem smart contract 306.

As noted above, the relay system smart contract 306, the relay systemcontroller 308, and the relay system node 310 operate together as arelay system to relay the data or requests from the client smartcontract 304 to the network 314 and relay data or request results fromthe network 314 to the client smart contract 304. The relay system smartcontract 306 is a smart contract that acts as a front end of theblockchain 302 within the relay system. The relay system smart contract306 includes or operates as an application program interface (API) tothe client smart contract 304 for processing and relaying the requestsfrom the client smart contract 304 to the other components of the relaysystem (e.g., the relay system controller 308), and for processing andrelaying request results from the relay system controller 308 to theclient smart contract 304. In some embodiments, the relay system smartcontract 306 verifies signatures associated with the request resultsbefore relaying the request results to the client smart contract 304.

The relay system controller 308 includes any suitable computer,processor, module, or computing element to relay requests from the relaysystem smart contract 306 to the relay system node 310 and to relayrequest results from the relay system node 310 to the relay system smartcontract 306. As such, the relay system controller 308 operates as amonitoring entity that monitors the state of the relay system smartcontract 306, because the relay system smart contract 306 does not havedirect connectivity to the network 314.

The relay system controller 308 also relays attestation evidence 320that indicates a legitimacy of the relay system node 310 from the relaysystem node 310 to the attestation service 312. In some embodiments, theattestation evidence 320 includes a measurement value 322 of the relaysystem node 310 and a signature 326 of the relay system node 310. Themeasurement value 322 of the relay system node 310 may include a hashvalue of an initial state of the relay system node 310. The signature326 of the relay system node 310 included in the attestation evidence320 may include the measurement value 322 of the relay system node 310that is signed using an attestation key of the relay system node 310.

In some embodiments, the attestation key of the relay system node 310includes an enhanced privacy identification (EPID) private key. EPID isan algorithm provided by Intel for attestation of a trusted system,while preserving privacy. In general, each of the members (e.g., acomputer or a server) of a network is assigned an EPID private key forsigning the attestation evidence, and a verifier of the attestationevidence in the network stores an EPID public key that is paired withthe EPID private keys of the other members of the network. Each of themembers can generate a signature of the attestation evidence using itsown EPID private key, and the verifier can verify the signatures of theother members using the EPID public key. As such, the EPID keys can beused to prove that a device, such as a computer or a server, is agenuine device.

The attestation evidence 320 may further include a public key 324 thatis generated by the relay system node 310. If the attestation evidence320 includes the public key 324 that is generated by the relay systemnode 310, the signature 326 of the relay system node 310 includes themeasurement value 322, and the public key 324 that are signed using theattestation key of the relay system node 310.

The relay system node 310 includes any suitable server, computer,module, or computing element to ingest and fulfill requests from theblockchain 302. For example, the relay system node 310 may receive andhandle off-chain service requests from clients and query external datasource in the network 314, for example such as, HTTPS-enabled Internetservices. Before handling the requests from clients or client smartcontract 304, the relay system node 310 may generate the attestationevidence 320, and send the attestation evidence 320 to the attestationservice 312 for verifying a legitimacy of the relay system node 310. Insome embodiments, the relay system node 310 generates a key pairincluding a public key 324 and a private key, and includes the publickey 324 in the attestation evidence 320. The public key 324 may befurther relayed by the relay system controller 308 to the relay systemsmart contract 306 for future communication between the relay systemsmart contract 306 and the relay system node 310. For example, the relaysystem node 310 may use the private key to sign request results, and therelay system smart contract 306 can use the public key 324 to verify thesigned request results.

The attestation service 312 includes any suitable server, computer,module, or computing element to verify the legitimacy of the attestationevidence 320 that is forwarded by the relay system controller 308 fromthe relay system node 310. As noted above, the attestation evidence 320includes a measurement value 322 of the relay system node 310, asignature 326 of the relay system node 310, and/or a public key 324generated by the relay system node 310. Upon receiving the attestationevidence 320, the attestation service 312 verifies the signature 326 ofthe relay system node 310 in the attestation evidence 320, and generatesan attestation verification report (AVR) 330.

The attestation service 312 verifies the signature 326 in theattestation evidence 320 using an attestation key of the attestationservice 312. In some embodiments, the attestation key of the attestationservice 312 includes an EPID public key that is paired with the EPIDprivate key that the relay system node 310 used to sign the attestationevidence 320. After verifying the signature in the attestation evidence320, the attestation service 312 generates the AVR 330 that includes theattestation evidence 320, a verification result 334 indicating whetherthe signature 326 in the attestation evidence 320 is valid, and asignature 336 of the attestation service 312.

In some embodiments, the AVR 330 includes the attestation evidence 320excluding the signature 326 of the relay system node 310. For example,the AVR 330 may include the measurement value 322 of the relay systemnode 310, the public key 324 generated by the relay system node 310, theverification result 334, and the signature 336 of the attestationservice 312. In some embodiments, the signature 336 of the attestationservice 312 includes the attestation evidence 320 and the verificationresult 334 that are signed using a report signing key (e.g., a privatekey that the attestation service 312 uses to sign the attestationverification report) of the attestation service 312. Note that thereport signing key can be different from the attestation key of theattestation service 312.

In some embodiments, the relay system includes a plurality of relaysystem nodes 310. The remote attestation process described herein isperformed for each relay system node 310, and for each relay system node310, a key pair (public key, private key) is provided. In some examples,as a relay system node 310 is verified, the relay system node 310 islogged with the relay system smart contract 306, and the relay systemsmart contract 306 is provided with the public key of the relay systemnode 310. Accordingly, each of a plurality of relay system nodes 310 arelogged with the relay system smart contract 306, which stores the publickey for each of the logged relay system nodes 310.

FIG. 4 depicts an example of a signal flow 400 in accordance withembodiments of this specification. The signal flow 400 represents anattestation verification process. For convenience, the process will bedescribed as being performed by a system of one or more computers,located in one or more locations, and programmed appropriately inaccordance with this specification. For example, a distributed system(e.g., the blockchain system 100 of FIG. 1; the system 300 of FIG. 3),appropriately programmed, can perform the process.

Generally, in operation, the relay system controller 308 receivesattestation evidence from a relay system node 310, and sends theattestation evidence to the attestation service 312 to verify theattestation evidence. The relay system controller 308 receives an AVRfrom the attestation service 312 that indicates a legitimacy of therelay system node 310 based on a verification on a signature of therelay system node 310 in the attestation evidence. The relay systemcontroller 308 further relays the AVR including a signature of theattestation service 312 to the relay system smart contract 306.

In the example of FIG. 4, the relay system controller 308 sends (410) anattestation request (e.g., a challenge) to the relay system node 310.The attestation request is sent to the relay system node 310 to requestattestation evidence that indicates a legitimacy or validity of therelay system node 310. In some embodiments, the attestation evidenceincludes a measurement value of the relay system node 310 and asignature of the relay system node 310. The measurement value of therelay system node 310 may include a hash value of an initial state ofthe relay system node 310. For example, the measurement value of therelay system node 310 may include a hash value of a process code that isimplemented on the relay system node 310.

In some embodiments, prior to sending the attestation request to therelay system node 310, the relay system controller 308 obtains themeasurement value of the relay system node 310 and sends the measurementvalue to the relay system smart contract 306 for future use. Forexample, the relay system smart contract 306 may store the measurementvalue of the relay system node 310 and compare the stored measurementvalue to a measurement value in an AVR that the relay system controller308 will forward from the attestation service 312 to the relay systemsmart contract 306.

In response to the attestation request, the relay system node 310generates (412) attestation evidence. As noted above, the attestationevidence indicates a legitimacy or validity of the relay system node310, and can include a measurement value of the relay system node 310and a signature of the relay system node 310. In some embodiments, theattestation evidence further includes a public key that is generated byrelay system node 310. For example, the relay system node 310 maygenerate a random cryptographic key pair including a private key and apublic key using a predetermined key generation algorithm, for examplesuch as, Rivest-Shamir-Adleman (RSA) algorithm. In some examples, thepublic key is provided in the attestation evidence that will be sent tothe relay system smart contract 306, and can be used for futurecommunication between the relay system smart contract 306 and the relaysystem node 310. For example, the relay system node 310 may use theprivate key to sign a request result and the relay system smart contract306 can use the public key to verify the signed request result.

In some embodiments, the measurement value of the relay system node 310includes a hash value of an initial state of the relay system node 310.The signature of the relay system node 310 in the attestation evidenceincludes the measurement value and the public key generated by the relaysystem node 310 that are signed using an attestation key of the relaysystem node 310. In some embodiments, the attestation key of the relaysystem node 310 includes an EPID private key. Attestation evidence thatis signed using an EPID private key can be verified by a verifier usingan EPID public key that is paired with the EPID private key to prove agenuineness of a device that generates the attestation evidence.

The relay system node 310 sends (414) the attestation evidence to therelay system controller 308. The attestation evidence that is sent tothe relay system controller 308 can include a measurement value of arelay system node 310, a public key that is generated by the relaysystem node 310, and a signature of the relay system node 310 includingthe measurement value and the public key that are signed using an EPIDprivate key of the relay system node 310.

The relay system controller 308 forwards (416) the attestation evidencesent from the relay system node 310 to the attestation service 312. Insome embodiments, the relay system controller 308 sends an attestationverification request to the attestation service 312. The attestationverification request includes the attestation evidence sent from therelay system node 310, and some supplemental information, such as, forexample, a descriptor that indicates whether the relay system node 310uses the SGX platform service.

The attestation service 312 verifies (418) the attestation evidence inresponse to receiving the attestation evidence forwarded by the relaysystem controller 308. As noted, the attestation evidence includes ameasurement value of the relay system node 310, a public key that isgenerated by the relay system node 310, and a signature of the relaysystem node 310. The attestation service 312 may verify the attestationevidence by verifying the signature of the relay system node 310 in theattestation evidence using an attestation key of the attestation service312. For example, the attestation service 312 may verify the signatureof the relay system node 310 using an EPID public key of the attestationservice that is paired with an EPID private key the relay system node310 uses to sign the attestation evidence.

If the attestation service 312 determines that the signature of therelay system node 310 in the attestation evidence is valid, theattestation service 312 may determine that the relay system node 310 isa genuine or legitimate device. If the attestation service 312determines that the signature of the relay system node 310 in theattestation evidence is invalid, the attestation service 312 maydetermine that the relay system node 310 is not genuine or is anillegitimate device, and reject any subsequent data and requests fromthe relay system node 310.

The attestation service 312 generates (420) an AVR based on averification of the attestation evidence. In some embodiments, the AVRcan include the attestation evidence of the relay system node 310, anattestation verification result, and a digital signature of theattestation service 312. In some embodiments, the AVR may include theattestation evidence of the relay system node 310 excluding thesignature of the relay system node 310. For example, the AVR may includethe measurement value of the relay system node 310, the public keygenerated by the relay system node 310, the attestation verificationresult, and the signature of the attestation service 312.

The attestation verification result in the AVR indicates whether thesignature of the relay system node 310 is valid. For example, theattestation verification result may include a value of “valid,” or “OK”that indicates the signature of relay system node 310 is valid or avalue of “invalid” that indicates the signature is invalid.

In some embodiments, the signature of the attestation service 312includes the attestation evidence and the attestation verificationresult that are signed using a report signing key. The report signingkey may be a private key that the attestation service 312 uses to signthe AVR. In some embodiments, the report signing key is generated by theattestation service 312 using a predetermined key generated algorithm.For example, the report signing key may be generated using theRSA-Secure Hash Algorithm (SHA) 256. Note that the report signing key isdifferent from the attestation key (e.g., EPID public key) that theattestation service 312 uses to verify the attestation evidence.

In some embodiments, the attestation service 312 sends (422) the AVR tothe relay system controller 308. As noted above, the AVR includes acryptographically signed report of verification of identity of the relaysystem node 310, and can include the attestation evidence of the relaysystem node 310, an attestation verification result, and a digitalsignature of the attestation service 312.

In some embodiments, the relay system controller 308 forwards (424) theAVR to the relay system smart contract 306 after receiving the AVR fromthe attestation service 312. The relay system smart contract 306verifies (426) the AVR. For example, the relay system smart contract 306may verify the signature of the attestation service 312 in the AVR. Insome embodiments, the relay system smart contract 306 verifies thesignature of the attestation service 312 using a report signingcertificate. The report signing certificate may be an X.509 digitalcertificate. The report signing certificate may include a public keythat is generated by the attestation service 312 and that is paired withthe report signing key the attestation service 312 uses to sign the AVR.If the relay system smart contract 306 verifies that the signature ofthe attestation service 312 in the AVR is valid, the relay system smartcontract 306 determines that the AVR is indeed sent by the attestationservice 312. If the relay system smart contract 306 determines that thesignature of the attestation service 312 in the AVR is invalid, therelay system smart contract 306 determines that the attestationverification report is not genuine, and will reject the AVR. The relaysystem smart contract 306 may further inspect the attestationverification result in the AVR to determine whether the attestationevidence of the relay system node 310 is valid. In some embodiments, therelay system smart contract 306 further compares the measurement valuein the attestation evidence with a measurement value that is pre-storedin the relay system smart contract 306 to determine whether theattestation evidence is valid.

The relay system smart contract 306 registers (428) the relay systemnode 310 as a valid or legitimate device in response to determining thatthe AVR is genuine and that the attestation evidence of the relay systemnode 310 is valid. The relay system smart contract 306 may further storethe public key that is included in the attestation evidence in theservice and that is generated by the relay system node 310. The publickey will be used by the relay system smart contract 306 for futurecommunication between the relay system smart contract 306 and the relaysystem node 310.

As described above, the signal flow 400 of FIG. 4 can be performed foreach of a plurality of relay system nodes 310. In this manner, each of aplurality of relay system nodes 310 are logged with the relay systemsmart contract 306, which stores the public key for each of the loggedrelay system nodes 310.

FIG. 5 depicts an example of a process 500 for verifying requests. Forconvenience, the process 500 will be described as being performed by asystem of one or more computers, located in one or more locations, andprogrammed appropriately in accordance with this specification. Forexample, a distributed system (e.g., the blockchain system 100 of FIG. 1and the system 300 of FIG. 3), appropriately programmed, can perform theprocess 500.

Generally in operation, a client smart contract 304 generates a requestthat will be relayed to the relay system node 310 through the relaysystem smart contract 306, and the relay system controller 308. Therelay system node 310 queries an Internet data source 504. In someexamples, the Internet data source 504 is a public data source, andcredentials are not required for access. The relay system node 310receives a response from the Internet data source 314, and the responseis returned to the client smart contract 304 in accordance withembodiments of this specification.

In further detail, the user client smart contract 304 sends (512) arequest for data or service from the Internet-based data source 504. Therequest is sent from the client smart contract 304 to the relay systemsmart contract 306. In some examples, the request may be a request forpublicly available data from a publicly accessible website. The requestmay include a plaintext portion, such as, for example, a web address(URL) of the Internet data source 504, and one or more requestparameters (e.g., parameters indicating the data, and/or service that isrequested). In response to receiving the request, the relay system smartcontract 306 selects (514) a relay system node 310 from a plurality ofrelay system nodes 310. For example, and as described herein, aplurality of relay system nodes 310 can be registered with the relaysystem smart contract 306. In some examples, the relay system smartcontract 306 randomly selects a relay system node 310 from the pluralityof relay system nodes 310.

The relay system smart contract 306 sends (516) the request to the relaysystem controller 308, which sends (518) the request to the relay systemnode 310. In some examples, the relay system smart contract 306 sendsthe request with an indicator of the relay system node 310 that is toreceive the request (e.g., the relay system node 310 that was selectedby the relay system smart contract 306). For example, the request can bemodified by the relay system smart contract 306 to include an identifier(e.g., URL) of the relay system node 310. In some examples, the relaysystem smart contract 306 sends the request as a log message.

In response to receiving the request, the relay system node 310 queries(520) the Internet data source 504. For example, the relay system node310 can formulate the query to request data from the Internet datasource 504 (e.g., using an HTTP GET method). In some examples, the querycan include the one or more request parameters. In response to receivingthe query, the Internet data source 504 processes (522) the query toprovide a response. For example, the Internet data source 504 canprocess the one or more request parameters to identify data that isresponsive to the one or more request parameters, and provide a resultthat includes the data. The Internet data source 504 sends (524) theresult to the relay system node 310.

The relay system node 310 processes (524) the result to provide aresponse. In accordance with embodiments of this specification, therelay system node 310 signs the result using its private key to providethe response. As described herein, the private key is generated duringthe remote attestation of the relay system node 310. In further detail,the result, or at least a portion of the result (e.g., the data) isprocessed by the relay system node 310 through a hash function toprovide a first hash value. An example of a hash function includes,without limitation, SHA-256. The relay system node 310 generates adigital signature based on the first hash value and the private key. Forexample, the first hash value and the private key are processed througha signature algorithm, which provides the digital signature. The relaysystem node 310 provides the response, which includes the results (e.g.,the data) and the digital signature. The relay system node 310 sends(528) the response to the relay system controller 308, which sends (530)the response to the relay system smart contract 306.

The relay system smart contract 306 processes (532) the response toensure the integrity of the response. In accordance with embodiments ofthe present disclosure, the relay system smart contract 306 processesthe result (e.g., the data) through a hash function (e.g., SHA-256) toprovide a second hash value. The relay system smart contract 306processes the digital signature and the public key of the relay systemnode 310 through a verification algorithm to provide the first hashvalue. For example, the relay system smart contract 306 decrypts thedigital signature using the public key to reveal the first hash value.As described herein, the public key is generated during the remoteattestation of the relay system node 310.

The relay system smart contract 306 verifies the integrity of theresponse based on the first hash value and the second hash value. Forexample, the relay system smart contract 306 compares the first hashvalue to the second hash value. If the first hash value and the secondhash value are not the same, the response has been tampered with, and isuntrusted. Consequently, the relay system smart contract 306 does notprovide the result (e.g., the data) to any downstream components (e.g.,the client smart contract), and/or can flag an error. If the first hashvalue and the second hash value are the same, the integrity of theresponse is intact. Consequently, the relay system smart contract 306provides the result (e.g., the data) to the client smart contract 304for further processing.

FIG. 6 is a flow chart illustrating an example of a process 600 that canbe executed in accordance with embodiments of this specification. Insome embodiments, the example process 600 may be performed using one ormore computer-executable programs executed using one or more computingdevices. In some examples, the example process 600 can be performed by arelay system for retrieving data that is external to a blockchainnetwork (e.g., the relay system smart contract 306, the relay systemcontroller 308, the relay system node 310 of FIG. 3).

At 602, a relay system controller sends an attestation request to arelay system node that requests an attestation evidence from the relaysystem node. In some embodiments, the attestation evidence indicates avalidity of the relay system node. In some embodiments, prior to therelay system controller sending the attestation request, a relay systemsmart contract obtains the measurement value of the relay system nodefrom the relay system node and stores the measurement value in the relaysystem smart contract. In some embodiments, the relay system contractexecutes on a blockchain network node of a blockchain network. In someembodiments, the relay system controller and the relay system node arelocated external to the blockchain network.

At 604, the relay system controller receives an attestation evidence ofthe relay system node from the relay system node. In some embodiments,the attestation evidence of the relay system node includes a measurementvalue of the relay system node, a public key of the relay system node,and a digital signature of the relay system node. In some embodiments,the measurement value of the relay system node includes a hash value ofa process code that is implemented on the relay system node. In someembodiments, the digital signature of the relay system node includes themeasurement value and the public key of the relay system node that aresigned using an attestation private key of the relay system node.

At 606, the relay system controller sends the attestation evidence ofthe relay system node to an attestation verification server. In someembodiments, the attestation verification server verifies the digitalsignature of the relay system node in the attestation evidence of therelay system node using an attestation public key of the attestationserver.

At 608, the relay system controller receives an attestation verificationreport from the attestation verification server. In some embodiments,the attestation verification report includes the attestation evidence ofthe relay system node, an attestation verification result, and a digitalsignature of the attestation verification server.

At 610, the relay system controller sends the attestation verificationreport to a relay system smart contract. In some embodiments, the relaysystem smart contract determines whether the attestation verificationreport in valid. In some embodiments, the relay system smart contractdetermines whether the digital signature of the attestation verificationserver is valid. In some embodiments, the relay system smart contractdetermines whether the measurement value of the relay system node thatis in the attestation verification report matches a measurement value ofthe relay system node that the relay system smart contract obtains fromthe relay system controller. In some embodiments, in response todetermining that the attestation verification report is valid, the relaysystem smart contract determines that the public key of the relay systemis valid. In some embodiments, the relay system smart contract storesthe public key of the relay system node in the relay system smartcontract.

FIG. 7 is a diagram illustrating an example of modules of an apparatus700 in accordance with embodiments of this specification. The apparatus700 can be an example embodiment of a relay system controller. Theapparatus 700 can correspond to the embodiments described above, and theapparatus 700 includes the following: a first sending module 702 thatsends an attestation request that requests an attestation evidence fromthe relay system node to a relay system node, the attestation evidenceindicating a validity of the relay system node; a first receiving module704 that receives an attestation evidence of the relay system node fromthe relay system node, the attestation evidence of the relay system nodecomprising a measurement value of the relay system node, a public key ofthe relay system node, and a digital signature of the relay system node;a second sending module 706 that sends the attestation evidence of therelay system node to an attestation verification server; a secondreceiving module 708 that receives an attestation verification reportfrom the attestation verification server, the attestation verificationreport comprising the attestation evidence of the relay system node, anattestation verification result, and a digital signature of theattestation verification server; and a third sending module 710 thatsends the attestation verification report to a relay system smartcontract.

In an optional embodiment, the measurement value of the relay systemnode comprises a hash value of a process code that is implemented on therelay system node.

In an optional embodiment, the digital signature of the relay systemnode comprises the measurement value and the public key of the relaysystem node that are signed using an attestation private key of therelay system node.

In an optional embodiment, the digital signature of the relay systemnode in the attestation evidence of the relay system node is verified bythe attestation verification server using an attestation public key ofthe attestation verification server prior to the attestationverification server sending the attestation verification report to therelay system controller.

In an optional embodiment, the relay system smart contract executes on ablockchain network node of a blockchain network, and wherein the relaysystem controller and the relay system node are located external to theblockchain network.

In an optional embodiment, prior to sending the attestation request, therelay system smart contract obtains a measurement value of the relaysystem node and stores the measurement value in the relay system smartcontract.

In an optional embodiment, the relay system smart contract determineswhether the attestation verification report is valid. In response todetermining that the attestation verification report is valid, the relaysystem smart contract determines that the public key of the relay systemis valid. The relay system smart contract stores the public key of therelay system node in the relay system smart contract.

In an optional embodiment, the relay system smart contract determineswhether the digital signature of the attestation verification server isvalid. The relay system smart contract determines whether themeasurement value of the relay system node that is in the attestationverification report matches a measurement value of the relay system nodethat the relay system smart contract obtains from the relay systemcontroller.

The system, apparatus, module, or unit illustrated in the previousembodiments can be implemented by using a computer chip or an entity, orcan be implemented by using a product having a certain function. Atypical embodiment device is a computer, and the computer can be apersonal computer, a laptop computer, a cellular phone, a camera phone,a smartphone, a personal digital assistant, a media player, a navigationdevice, an email receiving and sending device, a game console, a tabletcomputer, a wearable device, or any combination of these devices.

For an embodiment process of functions and roles of each module in theapparatus, references can be made to an embodiment process ofcorresponding steps in the previous method. Details are omitted here forsimplicity.

Because an apparatus embodiment basically corresponds to a methodembodiment, for related parts, references can be made to relateddescriptions in the method embodiment. The previously describedapparatus embodiment is merely an example. The modules described asseparate parts may or may not be physically separate, and partsdisplayed as modules may or may not be physical modules, may be locatedin one position, or may be distributed on a number of network modules.Some or all of the modules can be selected based on actual demands toachieve the objectives of the solutions of the specification. A personof ordinary skill in the art can understand and implement theembodiments of the present application without creative efforts.

Referring again to FIG. 7, it can be interpreted as illustrating aninternal functional module and a structure of an attestationverification apparatus. The attestation verification apparatus can be anexample of a relay system controller. An execution body in essence canbe an electronic device, and the electronic device includes thefollowing: one or more processors; and one or more computer-readablememories configured to store an executable instruction of the one ormore processors. In some embodiments, the one or more computer-readablememories are coupled to the one or more processors and have programminginstructions stored thereon that are executable by the one or moreprocessors to perform algorithms, methods, functions, processes, flows,and procedures, as described in this specification.

The techniques described in this specification produce one or moretechnical effects. For example, embodiments of this specification ensurethe integrity of responses provided back to the blockchain network fromexternal data sources. Accordingly, embodiments of the presentdisclosure improve the integrity of communications between a blockchainnetwork, and components of a relay system that is used to retrieve datathat is external to the blockchain network. In this manner, potentialattack channels for malicious users are mitigated to enhance security.As another example, the relay system of this specification facilitatesavoiding a direct contact between the user and the relay system node,thereby avoiding exposing a position or access point of the relay systemnode. As such, the relay system node is less likely to be found andattacked by malicious actors over the network in many forms, such as,for example, DDoS attacks. This improves a security of the relay systemnode, thereby further improving a security of the communication betweenthe blockchain network and the relay system node.

Described embodiments of the subject matter can include one or morefeatures, alone or in combination. For example, in a first embodiment, amethod for performing attestation verification includes: sending, by arelay system controller and to a relay system node, an attestationrequest that requests an attestation evidence from the relay systemnode, the attestation evidence indicating a validity of the relay systemnode; receiving, at the relay system controller and from the relaysystem node, an attestation evidence of the relay system node, theattestation evidence of the relay system node comprising a measurementvalue of the relay system node, a public key of the relay system node,and a digital signature of the relay system node; sending, by the relaysystem controller and to an attestation verification server, theattestation evidence of the relay system node; receiving, by the relaysystem controller and from the attestation verification server, anattestation verification report, the attestation verification reportcomprising the attestation evidence of the relay system node, anattestation verification result, and a digital signature of theattestation verification server; and sending, by the relay systemcontroller and to a relay system smart contract, the attestationverification report.

A first feature, combinable with any of the following features,specifies that the measurement value of the relay system node comprisesa hash value of a process code that is implemented on the relay systemnode.

A second feature, combinable with any of the previous or followingfeatures, specifies that the digital signature of the relay system nodecomprises the measurement value and the public key of the relay systemnode that are signed using an attestation private key of the relaysystem node.

A third feature, combinable with any of the previous or followingfeatures, specifies that the digital signature of the relay system nodein the attestation evidence of the relay system node is verified by theattestation verification server using an attestation public key of theattestation verification server prior to the attestation verificationserver sending the attestation verification report to the relay systemcontroller.

A fourth feature, combinable with any of the previous or followingfeatures, specifies that the relay system smart contract executes on ablockchain network node of a blockchain network, and wherein the relaysystem controller and the relay system node are located external to theblockchain network.

A fifth feature, combinable with any of the previous or followingfeatures, specifies that, prior to sending the attestation request, therelay system smart contract obtains a measurement value of the relaysystem node and stores the measurement value in the relay system smartcontract.

A sixth feature, combinable with any of the previous or followingfeatures, specifies that the method further includes: relay system smartcontract determines whether the attestation verification report isvalid; in response to determining that the attestation verificationreport is valid, the relay system smart contract determines that thepublic key of the relay system is valid; and the relay system smartcontract stores the public key of the relay system node in the relaysystem smart contract.

A seventh feature, combinable with any of the previous or followingfeatures, specifies that the relay system smart contract determineswhether the digital signature of the attestation verification server isvalid, or determines whether the measurement value of the relay systemnode that is in the attestation verification report matches ameasurement value of the relay system node that the relay system smartcontract obtains from the relay system controller.

Embodiments of the subject matter and the actions and operationsdescribed in this specification can be implemented in digital electroniccircuitry, in tangibly-embodied computer software or firmware, incomputer hardware, including the structures disclosed in thisspecification and their structural equivalents, or in combinations ofone or more of them. Embodiments of the subject matter described in thisspecification can be implemented as one or more computer programs, e.g.,one or more modules of computer program instructions, encoded on acomputer program carrier, for execution by, or to control the operationof, data processing apparatus. For example, a computer program carriercan include one or more computer-readable storage media that haveinstructions encoded or stored thereon. The carrier may be a tangiblenon-transitory computer-readable medium, such as a magnetic, magnetooptical, or optical disk, a solid state drive, a random access memory(RAM), a read-only memory (ROM), or other types of media. Alternatively,or in addition, the carrier may be an artificially generated propagatedsignal, e.g., a machine-generated electrical, optical, orelectromagnetic signal that is generated to encode information fortransmission to suitable receiver apparatus for execution by a dataprocessing apparatus. The computer storage medium can be or be part of amachine-readable storage device, a machine-readable storage substrate, arandom or serial access memory device, or a combination of one or moreof them. A computer storage medium is not a propagated signal.

A computer program, which may also be referred to or described as aprogram, software, a software application, an app, a module, a softwaremodule, an engine, a script, or code, can be written in any form ofprogramming language, including compiled or interpreted languages, ordeclarative or procedural languages; and it can be deployed in any form,including as a stand-alone program or as a module, component, engine,subroutine, or other unit suitable for executing in a computingenvironment, which environment may include one or more computersinterconnected by a data communication network in one or more locations.

A computer program may, but need not, correspond to a file in a filesystem. A computer program can be stored in a portion of a file thatholds other programs or data, e.g., one or more scripts stored in amarkup language document, in a single file dedicated to the program inquestion, or in multiple coordinated files, e.g., files that store oneor more modules, sub programs, or portions of code.

Processors for execution of a computer program include, by way ofexample, both general- and special-purpose microprocessors, and any oneor more processors of any kind of digital computer. Generally, aprocessor will receive the instructions of the computer program forexecution as well as data from a non-transitory computer-readable mediumcoupled to the processor.

The term “data processing apparatus” encompasses all kinds ofapparatuses, devices, and machines for processing data, including by wayof example a programmable processor, a computer, or multiple processorsor computers. Data processing apparatus can include special-purposelogic circuitry, e.g., an FPGA (field programmable gate array), an ASIC(application specific integrated circuit), or a GPU (graphics processingunit). The apparatus can also include, in addition to hardware, codethat creates an execution environment for computer programs, e.g., codethat constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, or a combination of one or moreof them.

The processes and logic flows described in this specification can beperformed by one or more computers or processors executing one or morecomputer programs to perform operations by operating on input data andgenerating output. The processes and logic flows can also be performedby special-purpose logic circuitry, e.g., an FPGA, an ASIC, or a GPU, orby a combination of special-purpose logic circuitry and one or moreprogrammed computers.

Computers suitable for the execution of a computer program can be basedon general or special-purpose microprocessors or both, or any other kindof central processing unit. Generally, a central processing unit willreceive instructions and data from a read only memory or a random accessmemory or both. Elements of a computer can include a central processingunit for executing instructions and one or more memory devices forstoring instructions and data. The central processing unit and thememory can be supplemented by, or incorporated in, special-purpose logiccircuitry.

Generally, a computer will also include, or be operatively coupled toreceive data from or transfer data to one or more storage devices. Thestorage devices can be, for example, magnetic, magneto optical, oroptical disks, solid state drives, or any other type of non-transitory,computer-readable media. However, a computer need not have such devices.Thus, a computer may be coupled to one or more storage devices, such as,one or more memories, that are local and/or remote. For example, acomputer can include one or more local memories that are integralcomponents of the computer, or the computer can be coupled to one ormore remote memories that are in a cloud network. Moreover, a computercan be embedded in another device, e.g., a mobile telephone, a personaldigital assistant (PDA), a mobile audio or video player, a game console,a Global Positioning System (GPS) receiver, or a portable storagedevice, e.g., a universal serial bus (USB) flash drive, to name just afew.

Components can be “coupled to” each other by being commutatively such aselectrically or optically connected to one another, either directly orvia one or more intermediate components. Components can also be “coupledto” each other if one of the components is integrated into the other.For example, a storage component that is integrated into a processor(e.g., an L2 cache component) is “coupled to” the processor.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on, orconfigured to communicate with, a computer having a display device,e.g., a LCD (liquid crystal display) monitor, for displaying informationto the user, and an input device by which the user can provide input tothe computer, e.g., a keyboard and a pointing device, e.g., a mouse, atrackball or touchpad. Other kinds of devices can be used to provide forinteraction with a user as well; for example, feedback provided to theuser can be any form of sensory feedback, e.g., visual feedback,auditory feedback, or tactile feedback; and input from the user can bereceived in any form, including acoustic, speech, or tactile input. Inaddition, a computer can interact with a user by sending documents toand receiving documents from a device that is used by the user; forexample, by sending web pages to a web browser on a user's device inresponse to requests received from the web browser, or by interactingwith an app running on a user device, e.g., a smartphone or electronictablet. Also, a computer can interact with a user by sending textmessages or other forms of message to a personal device, e.g., asmartphone that is running a messaging application, and receivingresponsive messages from the user in return.

This specification uses the term “configured to” in connection withsystems, apparatus, and computer program components. For a system of oneor more computers to be configured to perform particular operations oractions means that the system has installed on it software, firmware,hardware, or a combination of them that in operation cause the system toperform the operations or actions. For one or more computer programs tobe configured to perform particular operations or actions means that theone or more programs include instructions that, when executed by dataprocessing apparatus, cause the apparatus to perform the operations oractions. For special-purpose logic circuitry to be configured to performparticular operations or actions means that the circuitry has electroniclogic that performs the operations or actions.

While this specification contains many specific embodiment details,these should not be construed as limitations on the scope of what isbeing claimed, which is defined by the claims themselves, but rather asdescriptions of features that may be specific to particular embodiments.Certain features that are described in this specification in the contextof separate embodiments can also be realized in combination in a singleembodiment. Conversely, various features that are described in thecontext of a single embodiments can also be realized in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially be claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claim may be directed to a subcombination orvariation of a subcombination.

Similarly, while operations are depicted in the drawings and recited inthe claims in a particular order, this should not be understood asrequiring that such operations be performed in the particular ordershown or in sequential order, or that all illustrated operations beperformed, to achieve desirable results. In certain circumstances,multitasking and parallel processing may be advantageous. Moreover, theseparation of various system modules and components in the embodimentsdescribed above should not be understood as requiring such separation inall embodiments, and it should be understood that the described programcomponents and systems can generally be integrated together in a singlesoftware product or packaged into multiple software products.

Particular embodiments of the subject matter have been described. Otherembodiments are within the scope of the following claims. For example,the actions recited in the claims can be performed in a different orderand still achieve desirable results. As one example, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In some cases, multitasking and parallel processing may beadvantageous.

1. A computer-implemented method for performing an attestationverification, the method comprising: receiving, by a relay systemcontroller and from a relay system smart contract on a blockchainnetwork, an attestation request that requests an attestation evidencefrom a relay system node, the attestation evidence indicating a validityof the relay system node; sending, by the relay system controller and tothe relay system node, the attestation request that requests theattestation evidence from the relay system node; receiving, at the relaysystem controller and from the relay system node, an attestationevidence of the relay system node, the attestation evidence of the relaysystem node comprising a measurement value of the relay system node, apublic key of the relay system node, and a digital signature of therelay system node, wherein the digital signature of the relay systemnode is generated using an attestation private key of the relay systemnode; sending, by the relay system controller and to an attestationverification server, the attestation evidence of the relay system node;receiving, by the relay system controller and from the attestationverification server, an attestation verification report, the attestationverification report comprising the attestation evidence of the relaysystem node, an attestation verification result, and a digital signatureof the attestation verification server; and sending, by the relay systemcontroller and to the relay system smart contract, the attestationverification report.
 2. The method of claim 1, wherein the measurementvalue of the relay system node comprises a hash value of a process codethat is implemented on the relay system node.
 3. The method of claim 1,wherein the digital signature of the relay system node comprises themeasurement value and the public key of the relay system node that aresigned using an attestation private key of the relay system node.
 4. Themethod of claim 1, wherein the digital signature of the relay systemnode in the attestation evidence of the relay system node is verified bythe attestation verification server using an attestation public key ofthe attestation verification server prior to the attestationverification server sending the attestation verification report to therelay system controller.
 5. The method of claim 1, wherein the relaysystem smart contract executes on a blockchain network node of theblockchain network, and wherein the relay system controller and therelay system node are located external to the blockchain network.
 6. Themethod of claim 1, wherein, prior to sending the attestation request,the method further comprises: obtaining, by the relay system smartcontract and from the relay system node, a measurement value of therelay system node; and storing, by the relay system smart contract, themeasurement value of the relay system node to the relay system smartcontract.
 7. The method of claim 1, wherein the method furthercomprises: determining, by the relay system smart contract, whether theattestation verification report is valid; in response to determiningthat the attestation verification report is valid, determining, by therelay system smart contract, that the public key of the relay system isvalid; and storing, by the relay system smart contract, the public keyof the relay system node in the relay system smart contract.
 8. Themethod of claim 7, wherein determining, by the relay system smartcontract, whether the attestation verification report is valid comprisesat least one of the following: determining, by the relay system smartcontract, whether the digital signature of the attestation verificationserver is valid; or determining, whether the measurement value of therelay system node that is in the attestation verification report matchesa measurement value of the relay system node that the relay system smartcontract obtains from the relay system node.
 9. A non-transitory,computer-readable storage medium storing one or more instructionsexecutable by a computer system to perform operations for performing anattestation verification, the operations comprising: receiving, by arelay system controller and from a relay system smart contract on ablockchain network, an attestation request that requests an attestationevidence from a relay system node, the attestation evidence indicating avalidity of the relay system node; sending, by the relay systemcontroller and to the relay system node, the attestation request thatrequests the attestation evidence from the relay system node; receiving,at the relay system controller and from the relay system node, anattestation evidence of the relay system node, the attestation evidenceof the relay system node comprising a measurement value of the relaysystem node, a public key of the relay system node, and a digitalsignature of the relay system node, wherein the digital signature of therelay system node is generated using an attestation private key of therelay system node; sending, by the relay system controller and to anattestation verification server, the attestation evidence of the relaysystem node; receiving, by the relay system controller and from theattestation verification server, an attestation verification report, theattestation verification report comprising the attestation evidence ofthe relay system node, an attestation verification result, and a digitalsignature of the attestation verification server; and sending, by therelay system controller and to a relay system smart contract, theattestation verification report.
 10. The non-transitory,computer-readable storage medium of claim 9, wherein the measurementvalue of the relay system node comprises a hash value of a process codethat is implemented on the relay system node.
 11. The non-transitory,computer-readable storage medium of claim 9, wherein the digitalsignature of the relay system node comprises the measurement value andthe public key of the relay system node that are signed using anattestation private key of the relay system node.
 12. Thenon-transitory, computer-readable storage medium of claim 9, wherein thedigital signature of the relay system node in the attestation evidenceof the relay system node is verified by the attestation verificationserver using an attestation public key of the attestation verificationserver prior to the attestation verification server sending theattestation verification report to the relay system controller.
 13. Thenon-transitory, computer-readable storage medium of claim 9, wherein therelay system smart contract executes on a blockchain network node of theblockchain network, and wherein the relay system controller and therelay system node are located external to the blockchain network. 14.The non-transitory, computer-readable storage medium of claim 9,wherein, prior to sending the attestation request, the operationsfurther comprise: obtaining, by the relay system smart contract and fromthe relay system node, a measurement value of the relay system node; andstoring, by the relay system smart contract, the measurement value ofthe relay system node to the relay system smart contract.
 15. Thenon-transitory, computer-readable storage medium of claim 9, theoperations further comprising: determining, by the relay system smartcontract, whether the attestation verification report is valid; inresponse to determining that the attestation verification report isvalid, determining, by the relay system smart contract, that the publickey of the relay system is valid; and storing, by the relay system smartcontract, the public key of the relay system node in the relay systemsmart contract.
 16. The non-transitory, computer-readable storage mediumof claim 15, wherein determining, by the relay system smart contract,whether the attestation verification report is valid comprises at leastone of the following: determining, by the relay system smart contract,whether the digital signature of the attestation verification server isvalid; or determining, whether the measurement value of the relay systemnode that is in the attestation verification report matches ameasurement value of the relay system node that the relay system smartcontract obtains from the relay system node.
 17. A computer-implementedsystem, comprising: one or more computers; and one or more computermemory devices interoperably coupled with the one or more computers andhaving tangible, non-transitory, machine-readable media storing one ormore instructions that, when executed by the one or more computers,perform one or more operations for performing an attestationverification, the operations comprising: receiving, by a relay systemcontroller and from a relay system smart contract on a blockchainnetwork, an attestation request that requests an attestation evidencefrom a relay system node, the attestation evidence indicating a validityof the relay system node; sending, by the relay system controller and tothe relay system node, the attestation request that requests theattestation evidence from the relay system node; receiving, at the relaysystem controller and from the relay system node, an attestationevidence of the relay system node, the attestation evidence of the relaysystem node comprising a measurement value of the relay system node, apublic key of the relay system node, and a digital signature of therelay system node, wherein the digital signature of the relay systemnode is generated using an attestation private key of the relay systemnode; sending, by the relay system controller and to an attestationverification server, the attestation evidence of the relay system node;receiving, by the relay system controller and from the attestationverification server, an attestation verification report, the attestationverification report comprising the attestation evidence of the relaysystem node, an attestation verification result, and a digital signatureof the attestation verification server; and sending, by the relay systemcontroller and to a relay system smart contract, the attestationverification report.
 18. The system of claim 17, wherein the measurementvalue of the relay system node comprises a hash value of a process codethat is implemented on the relay system node.
 19. The system of claim17, wherein the digital signature of the relay system node comprises themeasurement value and the public key of the relay system node that aresigned using an attestation private key of the relay system node. 20.The system of claim 17, wherein the digital signature of the relaysystem node in the attestation evidence of the relay system node isverified by the attestation verification server using an attestationpublic key of the attestation verification server prior to theattestation verification server sending the attestation verificationreport to the relay system controller.
 21. The system of claim 17,wherein the relay system smart contract executes on a blockchain networknode of the blockchain network, and wherein the relay system controllerand the relay system node are located external to the blockchainnetwork.
 22. The system of claim 17, wherein, prior to sending theattestation request, the operations further comprise: obtaining, by therelay system smart contract and from the relay system node, ameasurement value of the relay system node; and storing, by the relaysystem smart contract, the measurement value of the relay system node tothe relay system smart contract.
 23. The system of claim 17, theoperations further comprising: determining, by the relay system smartcontract, whether the attestation verification report is valid; inresponse to determining that the attestation verification report isvalid, determining, by the relay system smart contract, that the publickey of the relay system is valid; and storing, by the relay system smartcontract, the public key of the relay system node in the relay systemsmart contract.
 24. The system of claim 23, wherein determining, by therelay system smart contract, whether the attestation verification reportis valid comprises at least one of the following: determining, by therelay system smart contract, whether the digital signature of theattestation verification server is valid; or determining, whether themeasurement value of the relay system node that is in the attestationverification report matches a measurement value of the relay system nodethat the relay system smart contract obtains from the relay system node.